package com.zzl.IO;

import java.io.FileReader;
import java.io.IOException;

public class FileIo {
	public static void main(String[] args) {
		FileReader fr = null;
		try {
			fr = new FileReader("demo.txt");  
			char[] buf = new char[1024];    //改长度通常是1024的整数倍
			int len = 0;
			while((len = fr.read(buf)) != -1){
				System.out.println(new String(buf,0,len));
			}
		} catch (IOException  e) {
			// TODO: handle exception
			System.out.println(e.toString());  
		}
	}

}
